﻿@model IEnumerable<vnMcdonald.Models.Order>
<table class="thetable">
    <tr><td colspan="6">
          Tổng tiền: <span style="color:blue;font-weight:bold">@{
        if (ViewBag.total == null)
	    {
		    ViewBag.total = 0;
        }        
    } @string.Format("{0:0,0}", ViewBag.total) VNĐ</span>
        </td>
    </tr>
    <tr>
        <th scope="col" width="5%">STT</th>
        <th scope="col" width="15%">MÃ ĐH</th>
        <th scope="col" width="20%">Tổng Giá(VNĐ)</th>
        <th scope="col" width="20%">Ngày tạo</th>
        <th scope="col" width="30%">Khách hàng</th>
        <th scope="col" width="10%">Tùy chọn</th>
    </tr>
    <tbody id="reloadorder">
        @{
            int i = 0;
            foreach (var item in Model)
            {
                i=i+1;
                <tr>
                    <td class="text-center">@i</td>
                    <td class="text-center">@Html.DisplayFor(modelItem => item.Codes)</td>
                    <td class="text-center">@Html.DisplayFor(modelItem => item.TotalPrice)</td>
                    <td class="text-center">@Html.DisplayFor(modelItem => item.CreateDate).ToString().Substring(0, 10)</td>
                    <td class="text-center">@Html.DisplayFor(modelItem => item.Recipient)</td>
                    <td class="text-center">
                        <a href="@Url.Action("OrderView","admin",new { id=item.OrderId })" title="Xem" class="view"><span>Xem</span></a>
                    </td>
                </tr>
            }
        }
        
    </tbody>
</table>